<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>核心函数</title>
    <script type="text/javascript" src="../script/jquery-1.7.2.js"></script>
    <script type="text/javascript">
        $(function () {
            $("<div>" +
                "        <span>span1</span>" +
                "        <span>span2</span>" +
                "    </div>").appendTo("body");
            var btn01 = $("#btn01");
            btn01.click(function () {
                console.log("btn01");
            });
            var buttons = $("button");
            console.log("buttons number: " + buttons.length);
            var test = document.getElementById("testDom");
            test.innerHTML = "test DOM"; // 可以起作用
            var testjQuery = $("#testjQuery");
            // testjQuery.innerHTML = "test jQuery"; // 无法起作用
            // console.log(testjQuery.innerHTML);
            // console.log(testjQuery.html());
            // testjQuery.html("abcd"); // 可以起作用
            testjQuery[0].innerHTML = "张三"; // 可以起作用
        });
    </script>
</head>
<body>
    <div id="testDom">test</div>
    <div id="testjQuery">test</div>
    <button id="btn01">btn01</button>
    <button id="btn02">btn02</button>
    <button id="btn03">btn03</button>
    <button id="btn04">btn04</button>
</body>
</html>